<?php
//1. CONNECTS TO THE DATABASE via CREDENTIALS DEFINED IN THE FOLLOWING VARIABLES

$host = 'localhost';
//DEFINES DATABASE TO CONNECT TO
$db = 'pepgsou_main';
//DEFINES WHICH USER TO CONNECT AS ON DATABASE
$user = 'pepgsou_admin';
//DEFINES THE PASSWORD OF THIS USER
$pass = '_20pepg09';
$con=mysql_connect($host,$user,$pass);
	if (!$con){
		die('Could not connect: ' . mysql_error());
		}
	else {
		mysql_select_db($db) or die("Unable to select database");}

if(!isset($_COOKIE['ID'])) {
header("location:login.php");
}

$myID = $_COOKIE['ID'];
$query = "SELECT * FROM course_selection WHERE student_id = '$myID'";
$result = mysql_query($query);
$rows = mysql_numrows($result);
$i = 0;
while ($i<$rows){
	$courseID[$i] = mysql_result($result,$i,"course_id");
	echo $courseID[$i];
	$query1 = "SELECT Title FROM JL WHERE CourseID = '$courseID[$i]'";
	$result1 = mysql_query($query1);
	$courseTitle[$i] = mysql_result($result1,0,"Title");
	echo $courseTitle[$i] . "<BR>";
	$i = $i + 1;
}

?>
<html>
<head>
</head>
<body>
<table border="1" bordercolor="#000000" style="background-color:#ffffff" width="400" cellpadding="3" cellspacing="0">
<tr>
		<td rowspan=2><center>Class Title</center></td>
		 <td colspan=2><center>SSHS-4 year plan: Freshman</center></td>
	</tr>
	<tr>
		 <td>Semester 1</td>
		 <td>Semester 2</td>
	</tr>
	<tr>
		<td>English</td>
		 <td colspan=2>
		 
		 </td>
	</tr>
	<tr>
		<td>Social Studies</td>
		 <td colspan=2>
		 
		 </td>
	</tr>
	<tr>
		<td>Science</td>
		 <td colspan=2>
		 
		 </td>
	</tr>
	<tr>
		<td>Math</td>
		 <td colspan=2>
		 
		 </td>
	</tr>
	<tr>
		<td>PE/Health</td>
		 <td>
  
		 </td>
		<td>
  
		</td>
	</tr>
	<tr>
		<td>Elective #1</td>
		 <td>
			
		</td>
		<td>
			
	</td>
	</tr>
	<tr>
		<td>Elective #2</td>
		 <td>
			
	</td>
		<td>
			
	</td>
	</tr>
</table>


<ul>Things to do
<li><s>Finish Action Script for Registration</s></li>
<li><s>Check if user has registered yet</s></li>
<ul>
	<li>If so, direct to userpanel</li>
	<li>If not, direct to registeration</li>
</ul>
<li>Create full registration</li>
<li>Create functioning cPanel, w/ the ability to view classes, update classes, graduation info, change password, and logout</li>
<!--<li></li>-->
</ul>
</body>
</html>